<!DOCTYPE HTML>
<html>
{include file='public/head'}
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="student_name" name="student_name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>年龄：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" autocomplete="off" value="" placeholder="" id="age" name="age">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="sex" type="radio" id="sex-1" value="1" checked>
					<label for="sex-1">男</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" name="sex" value="2">
					<label for="sex-2">女</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="phone" name="phone">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>紧急联系人：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="emergency" id="emergency">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>地址：</label>
			<div class="formControls col-xs-8 col-sm-9" data-toggle="distpicker"> <span class="select-box" style="width:150px;">
			<select class="select" name="address" size="1">
			</select>
			</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>身份证：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="card" id="card">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>毕业院校：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="school" id="school">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>毕业时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="button" class="btn btn-default" name="school_endtime" id="test1" style="width:150px;"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学历：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box" style="width:150px;">
			<select class="select" name="education" size="1">
				<option value="1">小学</option>
				<option value="2">初中</option>
				<option value="3">高中</option>
				<option value="4">专科</option>
				<option value="5">本科及以上</option>
			</select>
			</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否接触过编程：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="is_propramme" type="radio" id="is_propramme-1" value="1" checked>
					<label for="is_propramme-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="is_propramme-2" name="is_propramme" value="2">
					<label for="is_propramme-2">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>编程语言：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="programme_language" id="programme_language">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学习时长：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="填写几个月" name="study_year" id="study_year">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学习途径：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="study_approach" id="study_approach">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>如何知道这门技术的：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="is_know" id="is_know">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>如何知道欣才的：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="" name="is_know_ts" id="is_know_ts">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>选择班级：</label>
			<div class="formControls col-xs-8 col-sm-9"> <span class="select-box" style="width:150px;">
			<select class="select" name="classroom" size="1">
				{volist name='classroom' id='vo'}
				<option value="{$vo.cid}">{$vo.class_name}
				{switch vo.stage}
					{case 1}初级{/case}
					{case 2}中级{/case}
					{case 3}高级{/case}
					{/switch}
				</option>
				{/volist}
			</select>
			</span> </div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
{include file='public/foot'}
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="/static/stree/js/distpicker.data.js"></script>
<script type="text/javascript" src="/static/stree/js/distpicker.js"></script>
<script type="text/javascript" src="/static/stree/js/main.js"></script>
<script type="text/javascript" src="/static/layDate-v5.0.9/laydate/laydate.js"></script>
<script type="text/javascript">

    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        laydate.render({
            elem: '#test1'
        });
        $("#form-admin-add").validate({
            rules:{
                student_name:{
                    required:true,
                    minlength:2,
                    maxlength:5
                },
				age:{
                  required:true,
				},
				sex:{
                    required:true,
				},
                phone:{
                    required:true,
                    isPhone:true,
                },
                emergency:{
                  required:true,
				},
                address:{
                    required:true,
				},
                card:{
                    required:true,
					minlength:18,
				},
                school:{
                    required:true,
				},
				school_endtime:{
                  required:true
				},
                education:{
                    required:true,
				},
                is_propramme:{
                    required:true,
				},
                programme_language:{
                    required:true,
				},
                study_year:{
					required:true,
				},
                study_approach:{
                  required:true,
				},
                is_know:{
                    required:true,
				},
                is_know_ts:{
                  required:true,
				},
                classroom:{
                    required:true,
				}
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var school_endtime = $('#test1').val();
                $(form).ajaxSubmit({
                    type: 'post',
                    url: "{:url('admin/student/studentadd')}" ,
					dataType:'json',
					data:{school_endtime:school_endtime},
                    success: function(data){
                        if (data.status == 1) {
                            layer.msg(data.msg, {icon: 1, time: 1000}, function (index) {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.$('.btn-refresh').click();
                                parent.layer.close(index);
                            });
                        } else {
                            layer.msg(data.msg, {icon: 2, time: 1000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });
            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>